package component;

import javax.media.j3d.Transform3D;
import javax.vecmath.Point3d;

import node.BallNode;
import node.IntersectionValidator;

public class Ball extends AbstractComponent {

	private final BallNode ballNode;
	
	public Ball(Point3d position, IntersectionValidator validator) {
		super(validator);
		ballNode = new BallNode(this, position, Status.NORMAL);
		this.setGeoNode(ballNode);
	}
	
	@Override
	public void componentsConnected(Connection connection) {
//		System.out.println(connection.getTube());

	}

	@Override
	public void componentsDisconnected(Connection connection) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean canConnectTo(AbstractComponent other) {
		if (other instanceof Ball)
			return false;
		return other.canConnectTo(this);
	}

	@Override
	public void applyTransform(Transform3D transform) {
		Point3d pos = this.getPos();
		transform.transform(pos);
		this.setPos(pos);
	}

}
